class SceneTitle extends GuaScene {
    constructor(game) {
        super(game)
        self.game = game
        self = this
        game.registerAction('k', function() {
            var main = new Scene(self.game)
            game.replaceScene(main)

        })
        window.addEventListener('keydown', function(event) {
            if (event.key == 'f') {
                if (self.pause == true) {
                    self.pause = false
                } else {
                    self.pause = true
                }

            }
        })
        this.setUp()

    }
    setUp() {
        // this.particles = GuaParticleSystem.new(this.game)
        this.physical = Physical.new(this.game)
            // CollideSystem.new(game)
        this.physical.scene = this

        var b = Ball.new(this.game)
        var vx = randomBetween(2, 10)
        vx = 100
        var vy = 0
        b.init(20, 20, vx, vy, 0, 10)
        this.physical.addElement(b)
        this.addElement(this.physical)
    }


    draw() {
        super.draw()
            // this.game.context.strokeText('开始游戏', 20, 250)
    }

    update() {
        super.update()
    }

}